package com.wkk.websocket.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @author : WangKeKe
 * @date : 2020/8/17 14:41
 * Description : 消息实体类 - 与数据库表映射
 */

@Data
@Accessors(chain = true)
@ApiModel(description = "消息实体")
@TableName("no_message")
public class Message implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "消息ID，消息编号")
    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "消息发送者ID")
    private String sendId;

    @ApiModelProperty(value = "消息接收者ID")
    private String receiveId;

    @ApiModelProperty(value = "消息内容")
    private String content;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "消息发送时间")
    private Date createTime;

    @ApiModelProperty(value = "   * 消息类型\n" +
            "     * 公告  announcement\n" +
            "     * 一对一消息 singleChat\n" +
            "     * 一对多消息 groupChat")
    private String msgType;


    @ApiModelProperty(value = " 消息状态\n" +
            "     * 0 : 未发送\n" +
            "     * 1 : 发送成功\n" +
            "     * -1 : 发送失败")
    private Integer msgStatus;

    @ApiModelProperty(value = "消息发送失败原因")
    private String failCause;

    @ApiModelProperty(value = "逻辑删除")
    private Integer deleted;

}
